<?php

class Image extends AppModel {
    var $name = 'Image';


    var $validate = array( );

    /**
	 * Get all
	 *
	 * @param type  meta
	 * @return type  meta
	 * @access public
	 */
	function getAll($target_id = null ){
		return $this->find('all', array(
			'conditions' => array(
				'target_id' => $target_id
			)
		));
	}

	/**
	 *
	 *
	 * @param type  meta
	 * @return type  meta
	 * @access public
	 */
	function getOneNameImage($target_id) {
		$info = $this->find('first', array('fields' => array('image'), 'conditions' => array('target_id' => $target_id)));
		return isset($info['Image']['image']) ? $info['Image']['image'] : '';
	}
}
